package org.xiji.observer2;

public class Student implements Observer{
    private String name;

    public Student(String name)
    {
        this.name = name;
    }

    public String getName()
    {
        return name;
    }

    public void setName(String name)
    {
        this.name = name;
    }

    /**
     * 接受老师的消息
     *
     */

    @Override
    public void getMessage(Teacher teacher) {
        System.out.println(name + "接到通知:" + teacher.getMessage());
    }
}
